//
//  SIX_IAPHelper.h
//  sysg
//
//  Created by Cool.Cat on 14-5-13.
//
//

#ifndef sysg_SIX_IAPHelper_h
#define sysg_SIX_IAPHelper_h

#import <UIKit/UIKit.h>
#import <StoreKit/StoreKit.h>
#import <CommonCrypto/CommonCrypto.h>

@interface SIX_IAPHelper : NSObject <SKProductsRequestDelegate,SKPaymentTransactionObserver>
{
    BOOL bInited;
    NSString *pCallbackUrl;
    long long myUserIdx;
    NSString *myUserName;
    NSString *myUserPass;
    
    int merchantID;
    int applicationID;
    
    int productID;
    NSString *productName;
    int productItemPrice;
    int productItemPricePresent;
    int productExchangePrice;
    int productItemQuanitity;
    int productExchangeQuanitity;
    int productExchangeTotalFee;
    int productPayType;
    NSString *orderID;
    
    SKProductsRequest *itemRequest;
}

// 初始化
- (BOOL)Initialization:(NSString *)pUrl userIdx:(long long) idx userName:(NSString *)N userPass:(NSString *) P mchID:(int)mchID appID:(int)appID;
// 是否允许IAP
- (BOOL)canMakePurchases;
// 提交购买请求
- (int)BuyItem:(int)itemID itemName:(NSString *)itemName itemPrice:(int)itemPrice itemPricePresent:(int)itemPricePresent exchangePrice:(int)exchangePrice itemQuanitity:(int)itemQuanitity exchangeQuanitity:(int)exchangeQuanitity exchangeTotalFee:(int)exchangeTotalFee payType:(int)payType;

@end

#endif
